<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title><!-- Insert your title here --></title>
</head>
<body>
   <h1>ChessTrack </h1>
   <h2>Results</h2>
   
<?php

// get connection string variables
include 'config.php';

// get database information
include 'opendb.php';

//my query
$query  = "SELECT * from tournament";

//results variable
$result = mysql_query($query);

// while loop to go through database rows and present them.
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo "Name :{$row['tournament_id']} <br>" .
         "Subject : {$row['name']} <br>" .
         "Message : {$row['location']} <br><br>";
} 

$query2  = "SELECT * from player";
$result2 = mysql_query($query2);

while($row = mysql_fetch_array($result2, MYSQL_ASSOC))
{
    echo "Player ID :{$row['player_id']} <br />" .
         "Name : {$row['last_name']  } <br>" .
         "Message : {$row['elo']} <br><br>";
         
} 


// close db connection

mysql_close($conn);



?>

<p> getting info from:
http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/retrieve-data-from-a-mysql-database.aspx
</p>
  
    
</body>
</html>
